package tag26_14_08.Wdh;

public class BitteNichtAbtippen {

	public static void main(String[] args) {
		
		Integer i1 = 1; // 256 Integer-Objekte in der Integer.valueOf(1) gecached
		
		i1 = 126;
		
		i1++; //0 neue Integer-Objekte
		//i1 = i1 + 1;
		//i1 = Integer.valueOf( i1.intValue() + 1 ); // 127 => Referenz aus dem Integer-Pool
 
		i1++; //? neue Integer-Objekte
		//i1 = Integer.valueOf( i1.intValue() + 1 ); // 128 => new Integer(128);
		
		//------------------
		Integer x = 12;
		Integer y = x;
		
		x++;
		System.out.println("x == y -> " + (x==y) );
		
		System.out.println("------------------");
		x = 11;
		y = 12;
		x++;
		System.out.println("x == y -> " + (x==y) );

	}

}
